package com.financial.service.heemoney.controller.report;

import com.financial.service.heemoney.dto.inparameter.HeemoneyReportInParamDTO;
import com.financial.service.heemoney.dto.inparameter.HeemoneySplitAccountInParamDTO;
import com.financial.service.heemoney.service.FinancialReportHeemoneyService;
import com.financial.service.heemoney.utils.JsonUtils;
import com.financial.service.heemoney.utils.apiresult.ApiResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 汇收银商户报备信息
 *
 * @author zhaopengjun
 * @email dashuaizhao@aliyun.com
 * @date 2019-12-27 15:23:30
 */

@RestController
@RequestMapping("/heemoneyReport")
public class HeemoneyReportController {
    @Autowired
    private FinancialReportHeemoneyService financialReportHeemoneyService;

    @PostMapping("/report")
    public ApiResult report(@RequestBody HeemoneyReportInParamDTO heemoneyReportInParamDTO, HeemoneySplitAccountInParamDTO heemoneySplitAccountInParamDTO) {
        return financialReportHeemoneyService.report(heemoneyReportInParamDTO, heemoneySplitAccountInParamDTO);
    }

    @PostMapping("/reportTask")
    public ApiResult reportTask() {
        return financialReportHeemoneyService.reportTask();
    }

    @PostMapping("/asynReport")
    public ApiResult asynReport(@RequestParam String asynParam) {
        System.out.println("asynParam" + JsonUtils.objectToJson(asynParam));
        return financialReportHeemoneyService.asynReport(asynParam);
    }
}
